10 REM       GALISAT
15 REM 
20 TEXT: HOME: PRINT 
25 PRINT "WHICH IS TOWARD LEFT:"
30 INPUT "EAST OR WEST? ";A$
35 IF LEFT$(A$,1)="W" THEN 50
40 IF LEFT$(A$,1)="E" THEN 60
45 GOTO 30
50 L=1: L$="WEST": R$="EAST"
55 GOTO 65
60 L=-1: L$="EAST": R$="WEST"
65 GOSUB 800
70 N=J-2415020+F
75 PI=3.14159265: P=PI/180
80 VTAB 21: INVERSE: PRINT L$;
85 HTAB 37: PRINT R$: NORMAL 
90 VTAB 21:HTAB 7:PRINT "YEAR ";Y;
95 HTAB 19: PRINT "MONTH ";M;
100 HTAB 30: PRINT "DAY "
105 V=0: HGR : HCOLOR=3
110 GOSUB 295
115 DL=INT((N-INT(N))*20+0.5)/20
120 IF DL=0.5 THEN GOSUB 335
125 MT=(358.476+0.9856003*N)*P
130 MJ=(225.328+0.0830853*N)*P
135 JJ=221.647+0.9025179*N
140 VT=1.92*SIN(MT)+0.02*SIN(2*MT)
145 VJ=5.55*SIN(MJ)+0.17*SIN(2*MJ)
150 K=(JJ+VT-VJ)*P
155 DT=SQR(28.07-10.406*COS(K))
160 Z=SIN(K)/DT
165 I=ATN(Z/SQR(1-Z*Z))
170 I=I/P
175 F=(N-DT/173)
180 F1=I-VJ
185 U1=84.5506+203.405863*F+F1
190 U2=41.5015+101.2916323*F+F1
195 U3=109.9770+50.2345169*F+F1
200 U4=176.3586+21.4879802*F+F1
205 X1=5.906*SIN(U1*P+PI)
210 X=X1: GOSUB 315
215 X2=9.397*SIN(U2*P+PI)
220 X=X2: GOSUB 315
225 X3=14.989*SIN(U3*P+PI)
230 X=X3: GOSUB 315
235 X4=26.364*SIN(U4*P+PI)
240 X=X4: GOSUB 315
245 V=V+1: N=N+0.05
250 IF V>=155 THEN 265
255 IF D>=33 THEN 275
260 GOTO 115
265 INPUT "CONTINUE (Y OR N)?";A$
270 IF A$<>"N" THEN 105
275 INPUT "ANOTHER MONTH? ";A$
280 IF A$<>"N" THEN 20
285 TEXT: HOME 
290 END 
291 REM
295 REM  JUPITER DISPLAY
300 HPLOT 136,0 TO 136,155
305 HPLOT 142,0 TO 142,155
310 RETURN 
315 REM     SATELLITE DISPLAY
320 X=139+L*INT(X*3.5+0.5)
325 HPLOT X,V
330 RETURN 
335 REM   CHANGE OF DATE
340 VTAB 21: HTAB 34: PRINT D
345 HPLOT 5,V TO 25,V
350 HPLOT 255,V TO 275,V
355 D=D+1
360 RETURN 
365 REM
800 REM CALENDAR --> JD
805 REM 
810 INPUT "Y,M,D? ";Y,M,D
811 D=INT(D)
815 G=1: IF Y<=1582 THEN G=0
820 D1=INT(D): F=D-D1-0.5
825 J=-INT(7*(INT((M+9)/12)+Y)/4)
830 IF G=0 THEN 850
835 S=SGN(M-9): A=ABS(M-9)
840 J1=INT(Y+S*INT(A/7))
845 J1=-INT((INT(J1/100)+1)*3/4)
850 J=J+INT(275*M/9)+D1+G*J1
855 J=J+1721027+2*G+367*Y
860 IF F>=0 THEN 870
865 F=F+1: J=J-1
870 RETURN 
900 REM  **********************
910 REM  THIS PROGRAM COMPUTES
920 REM  POSITIONS OF THE FOUR 
930 REM  BRIGHT MOONS OF JUPITER
940 REM  ON APPLE II COMPUTERS.
950 REM  IT IS DESCRIBED IN SKY
960 REM  & TELESCOPE MAGAZINE, 
970 REM  JUNE, 1989, PAGE 650.
980 REM  **********************
